import { createPinia } from 'pinia'
import type {App}  from 'vue'
import { useLoginStore } from "@/stores/login/login"
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate) 
function registerStore(app:App<Element>) {
    app.use(pinia)
    // 如果页面刷新，在添加pinia之后，加载路由之前，添加所有路由信息到pinia中
    const loginStore = useLoginStore()
    loginStore.loadAllStaticInfo()
}
export default registerStore